#include "ros/ros.h"
#include "msg/circle.h"
using namespace std;

void doMsg(const msg::circle::ConstPtr& receivedMsg) {
    ROS_INFO("Received Circle : %f - %f", receivedMsg -> radius, receivedMsg -> area);
}

int main(int argc, char *argv[]) {
    setlocale(LC_ALL, "");
    ros::init(argc, argv, "subscriber");
    ros::NodeHandle nodeHandle;

    // 实例化 订阅者 对象
    ros::Subscriber subscriber = nodeHandle.subscribe<msg::circle>("msg_info", 10, doMsg);
    // 处理订阅的消息（传入回调函数）

    ros::spin(); // 循环读取接收的数据，并调用回调函数处理

    return 0;
}
